package org.ch02.job.test06;

import java.lang.reflect.Method;
import java.util.Scanner;

/**
 * @author XCH
 * @date 2025 - 03 - 17
 */
public class MainTest {
    public static void main(String[] args) throws NoSuchMethodException {
        Scanner sc = new Scanner(System.in) ;
        System.out.println("请输入年份");
        int year = sc.nextInt();
        sc.close();
        Class<?> clazz = Year.class;
        Method method = clazz.getMethod("isLeapYear", int.class);
        try {
            method.invoke(null, year);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }

    }
}
